package com.monkeysonnet.b2dFluent;

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.EdgeShape;

public class EdgeFactory  extends FixtureFactory<EdgeFactory>
{
	private EdgeShape _shape;
	
	public EdgeFactory()
	{
		this(false);
	}
	
	EdgeFactory(boolean managed)
	{
		super(managed);
		_shape = new EdgeShape();
		_def.shape = _shape;
	}
	
	public EdgeFactory between(Vector2 v1, Vector2 v2)
	{
		_shape.set(v1, v2);
		return this;
	}
	
	public EdgeFactory between(float x1, float y1, float x2, float y2)
	{
		_shape.set(x1, y1, x2, y2);		
		return this;
	}

	@Override
	public void free()
	{
		B2d.free(this);
	}
}
